import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView,
    redirect: "/collectionreport/connection",
    children: [
      {
        path: "/collectionreport",
        name: "collectionreport",
        component: () => import("../views/CollectionReport.vue"),
        children: [
          {
            path: "connection",
            component: () => import('../components/caiji/ConnectionView.vue')
          },
          {
            path: "dataccess",
            component: () => import("../components/caiji/dataccessView.vue")
          },
          {
            path: "status",
            name: "status",
            component: () => import("../components/caiji/ConnectionStatus.vue")
          }
        ]
      },
      {
        path: '/about',
        name: 'about',
        component: () => import('../views/AboutView.vue'),
        redirect: "/about/cleaningdetection",
        children: [
          {
            path: "cleaningdetection",
            component: () => import('../components/concordance/CleaningDetection.vue')
          },
          {
            path: "cleaningproblems",
            component: () => import("../components/concordance/CleaningProblems.vue")
          },
          {
            path: "convergenceassociation",
            component: () => import("../components/concordance/ConvergenceAssociation.vue")
          },
          {
            path: "governanceStatus",
            component: () => import("../components/concordance/governanceStatus.vue")
          },
          {
            path: "governanceIssues",
            component: () => import("../components/concordance/governanceIssues.vue")
          }
        ]
      },
      {
        path: '/datamanag',
        name: 'datamanag',
        component: () => import(/**/'../views/dataManagView.vue'),
        children: [
          {
            path: 'datasafeguard',
            name: "datasafeguard",
            component: () => import('../components/dataManage/dataSafeguard.vue'),
            children: [
              {
                path: "SdoAia131Image",
                name: "SdoAia131Image",
                component: () => import("../components/dataManage/dataSafeguards/SdoAia131Image.vue")
              },
              {
                path: "SdoAia171Image",
                name: "SdoAia171Image",
                component: () => import("../components/dataManage/dataSafeguards/SdoAia171Image.vue")
              },
              {
                path: 'SdoAia193Image',
                name: 'SdoAia193Image',
                component: () => import("../components/dataManage/dataSafeguards/SdoAia193Image.vue")
              },
              {
                path: 'SdoHmiImage',
                name: 'SdoHmiImage',
                component: () => import('../components/dataManage/dataSafeguards/SdoHmiImage.vue')
              },
              {
                path: 'ElectronFlux',
                name: 'ElectronFlux',
                component: () => import('../components/dataManage/dataSafeguards/ElectronFlux.vue')
              },
              {
                path: 'ProtonFlux',
                name: 'ProtonFlux',
                component: () => import('../components/dataManage/dataSafeguards/ProtonFlux.vue')
              },
              {
                path: 'SolarWind',
                name: 'SolarWind',
                component: () => import('../components/dataManage/dataSafeguards/SolarWind.vue')
              },
              {
                path: 'IntMag',
                name: 'IntMag',
                component: () => import('../components/dataManage/dataSafeguards/IntMag.vue')
              },
              {
                path: 'ScintS4',
                name: 'ScintS4',
                component: () => import('../components/dataManage/dataSafeguards/ScintS4.vue')
              },




              // {
              //   path: '',
              //   name: '',
              //   component: () => import('../components/dataManage/dataSafeguards/.vue')
              // },

              {
                path: "KjzElectronProtonFlux",
                name: "KjzElectronProtonFlux",
                component: () => import("../components/dataManage/dataSafeguards/KjzElectronProtonFlux.vue")
              },
              {
                path: "XRay",
                name: "XRay",
                component: () => import("../components/dataManage/dataSafeguards/XRay.vue")
              },



            ]
          },
          {
            path: 'statisticalreport',
            name: "statisticalreport",
            component: () => import('../components/dataManage/statisticalReport.vue')
          },
          {
            path: 'datastatus',
            name: "datastatus",
            component: () => import('../components/dataManage/dataStatus.vue')
          },
          {
            path: 'dailyrecord',
            name: "dailyrecord",
            component: () => import('../components/dataManage/dailyRecord.vue')
          }
        ]
      }, {
        path: "/dataservices",
        name: "dataservices",
        redirect: "/dataservices/ImagePlayer",
        component: () => import("../views/dataService/DataServicesView.vue"),
        children: [
          {
            path: 'ImagePlayer',
            name: "ImagePlayer",
            component: () => import('../views/dataService/components/ImagePlayer.vue')
          },
          {
            path: 'SolarWind',
            name: "SolarWind",
            component: () => import('../views/dataService/components/SolarWind.vue')
          }
        ]
      }, {
        path: "/eventReview",
        name: "eventReview",
        redirect: "/eventReview/knowledgeGraph",
        component: () => import("../views/IntelligentView.vue"),
        children: [
          {
            path: 'knowledgeGraph',
            name: "knowledgeGraph",
            component: () => import('../components/intelligent/eventReview.vue')
          },
          {
            path: 'thirdScene',
            name: "thirdScene",
            component: () => import('../components/intelligent/ThirdDScene.vue')
          }
        ]
      },
      // {
      //   path: "/eventReview",
      //   component: () => import("../components/intelligent/eventReview.vue"),
      // },
      // {
      //   path: "/magnetopause",
      //   component: () => import("../components/intelligent/magnetopauseView.vue")
      // },
      // {
      //   path: "/failureException",
      //   component: () => import("../components/intelligent/failureException.vue")
      // },
      {
        path: "/documentation",
        name: "documentation",
        component: () => import("../views/documentationView.vue")
      }
    ]
  },
  {
    path: "/crossignSouth",
    component: () => import("../components/intelligent/crossingSouth.vue")
  },
  {
    path: "/loginamepage",
    name: "loginamepage",
    component: () => import("../views/LoginPage.vue")
  },
]
const router = new VueRouter({
  routes
})

//获取原型对象上的push函数
const originalPush = VueRouter.prototype.push
//修改原型对象中的push方法
VueRouter.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}



export default router
